package com.sc.userspringboot.dao;

import com.sc.userspringboot.pojo.Posts;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 用户发布帖子主表 Mapper 接口
 * </p>
 *
 * @author user
 * @since 2025-09-19 06:25:46
 */
public interface IPostsDao extends BaseMapper<Posts> {
    List<Posts> selectRandomPosts(@Param("limit") int limit);

    List<Posts> getByPostId();

    //根据多个postId查询帖子和作者信息
    List<Posts> getUserPostsAndAuthor(List<Integer> postIds);

    List<Posts> getByPostId_limit(@Param("limit") int limit);

    Posts getByPostId_id(@Param("postId") Integer postId);

    List<Posts> getSort();

    List<Posts> getGamesId(@Param("gameId") Integer gameId, @Param("page") Integer page);

    List<Posts> getPublishTime(@Param("page") Integer page);
}
